import request from '../utils/request.js'


// 获取首页头部分类信息
export const findAllCategory = () => {
  return request({
    method: 'get',
    url: '/home/category/head'
  })
}

// 获取一级分类
export const findFirstClass = (id) => {
  return request({
    method: 'get',
    url: '/category',
    params: {
      id
    }
  })
}

// 获取二级分类筛选条件数据
export const findSubCategoryFilter = (id) => {
  return request({
    method: 'get',
    url: '/category/sub/filter',
    params: {
      id
    }
  })
}

// 获取分类下的商品（带筛选条件）
export const findSubCategoryGoods = data => {
  return request({
    method: 'POST',
    url: '/category/goods',
    data
  })
}